*******************************************	   
************* Table A 44 Counterfactual Experiment
*******************************************	   



clear all
clear matrix
set more off
set matsize 11000

* Use data from results: 

use "~/Dropbox/Replication_MVC/Datasets/datasets_analysis/panel_excombatientes.dta", clear 

* Do a stabilizing transformation (inverse hyperbolic sine, IHS) 
* to get better yhat predictions:
g ldiffcaptures = asinh(diffcaptures)
g ldiffcaptures_f = asinh(diffcaptures_f)

eststo clear
set more off

xi: areg ldiffcaptures_f gold_shock mean_gold_shock i.year i.origmun, absorb(wartimenetwork) vce(cluster wartimenetwork)
estadd local ALLFE = "$\checkmark$"
summ diffcaptures_f if e(sample) ==1
estadd local meanDep = trim("`: display %12.4fc `r(mean)''")
estadd local SDDep = trim("`: display %12.4fc `r(sd)''")
eststo

*Full model results (Table A52)
esttab est* using "~/Dropbox/Replication_MVC/Paper_tables/TableA44.tex", se ///
	   star(* 0.10 ** 0.05 *** 0.01 ) ///
	   stats(meanDep SDDep N ALLFE TT MT BC CO, fmt(%12.4fc %12.4fc  %12.0fc %12.0fc %12.0fc %12.0fc %12.0fc %12.0fc) ///
	   label("\small Mean of Outcome" "\small S.D of Outcome" "\small Observations" "\small Municipality, Year, and Group FE" "\small Time Trends" "\small Region $\times$  Year" "\small Municipality Characteristics TT" ///
			"\small Individual Covariates" )) ///
	   varlabels(gold_shock "Economic Shock" mean_gold_shock "Average Shock" ) ///
	   ti("Economic Shock and Peer Effects for fragrant captures") ///	  
	   replace
